﻿using System;
using System.Windows.Forms;

using ProfileManager.DataAccess;

namespace ProfileManager.Forms
{
    public partial class AddServiceTypeForm : MasterForm
    {
        public AddServiceTypeForm()
        {
            InitializeComponent();

            ShowCustomLeftButton = false;
            ShowCustomRightButton = false;
        }

        private void AddServiceTypeForm_ClickOk(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(tbServiceTypeName.Text.Trim()))
            {
                ServiceType serviceType = new ServiceType(tbServiceTypeName.Text.Trim());
                serviceType.Insert();

                if (serviceType.Id != Guid.Empty)
                {
                    DialogResult = DialogResult.OK;
                }
            }
        }
    }
}
